home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / dp_asmdc / deepcryp.asm < prev    next >
Assembly Source File  |  1996-12-08  |  7KB  |  319 lines

  1. ────────────────────────────────────────────────────────────────────────────────
  2. ;  we need a crypter for the deep dialer! a good crypter...lets say we use a
  3. ;  1024 bit key for a inverted xor-algorhytm but with an included selfdecrypt
  4. ;  routine...plasmoid...diz program is know as the deep-dialer!
  5. ────────────────────────────────────────────────────────────────────────────────
  6. .model tiny
  7. code            segment use16
  8.         assume  cs:code,ds:code
  9.         org     100h
  10.         locals
  11. deepcrypter:    jmp     main
  12. ────────────────────────────────────────────────────────────────────────────────
  13. .386                        ; ∙ here we go again...
  14. ────────────────────────────────────────────────────────────────────────────────
  15. install        proc    near
  16.         mov    ah,42h
  17.         mov    al,2
  18.         xor    cx,cx
  19.         xor    dx,dx
  20.         int    21h
  21.         mov    leng,ax
  22.         sub    ax,4
  23.         mov word ptr newbytes[2],ax
  24.         mov    ah,42h
  25.         mov    al,0
  26.         xor    cx,cx
  27.         xor    dx,dx
  28.         int    21h
  29.         mov    ah,3fh
  30.         mov    cx,4
  31.         mov    dx,offset oldbytes
  32.         int    21h
  33.  
  34.         mov    ax,word ptr oldbytes[0]
  35.         cmp    ax,03646h
  36.         jne    notequal
  37.         mov    dx,offset erro_alread
  38.         call    message
  39.  
  40. notequal:    mov    ah,42h
  41.         mov    al,0
  42.         xor    cx,cx
  43.         xor    dx,dx
  44.         int    21h
  45.         mov    ah,40h
  46.         mov    cx,4
  47.         mov    dx,offset newbytes
  48.         int    21h
  49.  
  50.         mov    ah,42h
  51.         mov    al,2
  52.         xor    cx,cx
  53.         xor    dx,dx
  54.         int    21h
  55.         mov    ah,40h
  56.         mov    dx,offset decrypt
  57.         mov    cx,offset deend-offset decrypt
  58.         int    21h
  59.         ret
  60. newbytes    dd    0000e990h
  61. leng        dw    0
  62. install        endp
  63. ────────────────────────────────────────────────────────────────────────────────
  64. decrypt        proc    near
  65.         call    get_ip
  66. get_ip:        pop    cx
  67.         mov    bp,cx
  68.         sub    bp,offset get_ip
  69.         sub    cx,103h
  70.         mov    si,100h
  71.         lea    di,[bp+oldbytes]
  72.         mov    eax,[di]
  73.         mov    [si],eax
  74.         lea    di,[bp+key]
  75.         mov    dx,di
  76.         mov    bx,di
  77.         add    bx,31
  78.  
  79. decrypting:    mov    al,[si]
  80.         xor    al,[di]
  81.         not    al
  82.         mov    [si],al
  83.         inc    di
  84.         inc    si
  85.         cmp    di,bx
  86.         jbe    denochange
  87.         mov    di,dx
  88. denochange:    loop    decrypting
  89.         push    0100h
  90.         ret
  91. oldbytes    dd    0
  92. key        db    41,32,63,94,75,34,47,18,79,85,53,26,12,82,24,12
  93.         db    64,24,65,25,25,96,87,58,59,68,34,32,34,44,35,35
  94. deend        label    byte
  95. decrypt        endp
  96. ────────────────────────────────────────────────────────────────────────────────
  97. backup        proc    near
  98.         mov    ah,3ch
  99.         mov    dx,offset backname
  100.         mov    cx,00
  101.         int    21h
  102.         jnc    what
  103.         mov    dx,offset erro_intern
  104.         call    message
  105. what:        mov    dx,offset mess_create
  106.         call    message
  107.         mov    bp,ax
  108.         xchg    bx,bp
  109.         mov    dx,offset mess_backup
  110.         call    message
  111. backing:    xchg    bx,bp
  112.         mov    ah,42h
  113.         mov    al,00
  114.         mov    cx,word ptr point[2]
  115.         mov    dx,word ptr point[0]
  116.         int    21h
  117.         jnc    err1
  118.         mov    dx,offset erro_corrup
  119.         call    message
  120. err1:        mov    ah,3fh
  121.         mov    cx,50000
  122.         mov    dx,offset buffer
  123.         int    21h
  124.         push    ax
  125.  
  126.         xchg    bp,bx
  127.         mov    ah,42h
  128.         mov    al,00
  129.         mov    cx,word ptr point[2]
  130.         mov    dx,word ptr point[0]
  131.         int    21h
  132.  
  133.         pop    ax
  134.         mov    cx,ax
  135.         mov    ah,40h
  136.         mov    dx,offset buffer
  137.         int    21h
  138.         jnc    err2
  139.         mov    dx,offset erro_corrup
  140.         call    message
  141. err2:        add    point,50000
  142.         cmp    ax,50000
  143.         je    backing
  144.  
  145.         mov    ah,3eh
  146.         int    21h
  147.         ret
  148. backup        endp
  149. ────────────────────────────────────────────────────────────────────────────────
  150. getname        proc    near
  151.         mov    si,80h
  152.         mov    di,offset backname
  153.         xor    ch,ch
  154.         mov    cl,[si]
  155.         cmp    cl,5
  156.         ja    maybecom
  157.         mov    dx,offset erro_syntax
  158.         call    message
  159. maybecom:    add    si,2
  160.         dec    cx
  161.         push    si
  162.         mov    dx,cx
  163.         rep    movsb
  164.         mov    di,offset filename
  165.         pop    si
  166.         mov    cx,dx
  167.         rep    movsb
  168.         mov    di,offset backname
  169.         mov    cx,dx
  170. searchcom1:    cmp dword ptr [di],"moc."
  171.         je    found
  172.         inc    di
  173.         loop    searchcom1
  174.         mov    di,offset backname
  175.         mov    cx,dx
  176. searchcom2:    cmp dword ptr [di],"MOC."
  177.         je    found
  178.         inc    di
  179.         loop    searchcom2
  180.         mov    dx,offset erro_onlyco
  181.         call    message
  182. found:        mov    eax,"kab."
  183.         mov    [di],eax
  184.         ret
  185. getname        endp
  186. ────────────────────────────────────────────────────────────────────────────────
  187. message        proc    near
  188.         push    ax
  189.         push    dx
  190.         clc
  191.         mov    ah,09
  192.         int    21h
  193.         jnc    noerr6
  194.         mov    dx,offset erro_intern
  195.         mov    ah,09
  196.         int    21h
  197.         mov    ah,4ch
  198.         int    21h
  199. noerr6:        cmp    dx,offset erro_syntax
  200.         jb    nofault
  201.         mov    ah,4ch
  202.         int    21h
  203. nofault:    pop    dx
  204.         pop    ax
  205.         ret
  206. message        endp
  207. ────────────────────────────────────────────────────────────────────────────────
  208. openfile    proc    near
  209.         mov    ah,3dh
  210.         mov    dx,offset filename
  211.         mov    al,02
  212.         int    21h
  213.         jnc    okay
  214.         mov    dx,offset erro_nofile
  215.         call    message
  216. okay:        mov    dx,offset mess_openin
  217.         call    message
  218.         mov    bx,ax
  219.         ret
  220. filename    db    128 dup (0)
  221. backname    db    128 dup (0)
  222. point        dd    0
  223. openfile    endp
  224. ────────────────────────────────────────────────────────────────────────────────
  225. cryptit        proc    near
  226.         xchg    bp,bx
  227.         mov    dx,offset mess_crypti
  228.         call    message
  229.         mov    point,0
  230. loading:    mov    ah,42h
  231.         mov    al,00
  232.         mov    cx,word ptr point[2]
  233.         mov    dx,word ptr point[0]
  234.         int    21h
  235.         mov    ah,3fh
  236.         mov    cx,50000
  237.         mov    dx,offset buffer
  238.         int    21h
  239.         jnc    err3
  240.         mov    dx,offset erro_corrup
  241.         call    message
  242. err3:        push    ax
  243.         mov    cx,ax
  244.         mov    di,offset key
  245.         mov    si,offset buffer
  246. crypting:    mov    al,[si]
  247.         xor    al,[di]
  248.         not    al
  249.         mov    [si],al
  250.         inc    di
  251.         inc    si
  252.         cmp    di,offset key+31
  253.         jbe    nochange
  254.         mov    di,offset key
  255. nochange:    loop    crypting
  256.         mov    ah,42h
  257.         mov    al,00
  258.         mov    cx,word ptr point[2]
  259.         mov    dx,word ptr point[0]
  260.         int    21h
  261.         pop    ax
  262.         mov    cx,ax
  263.         mov    ah,40h
  264.         mov    dx,offset buffer
  265.         int    21h
  266.         jnc    err4
  267.         mov    dx,offset erro_corrup
  268.         call    message
  269. err4:        add    point,50000
  270.         cmp    ax,50000
  271.         jnb    loading
  272.         ret
  273. buffer        db    50000 dup (0)
  274. cryptit        endp
  275. ────────────────────────────────────────────────────────────────────────────────
  276. closefile    proc    near
  277.         mov    dx,offset mess_closin
  278.         call    message
  279.         mov    ah,3eh
  280.         int    21h
  281.         ret
  282. closefile    endp
  283. ────────────────────────────────────────────────────────────────────────────────
  284.  
  285. mess_crypta    db    0dh,0ah
  286.         db    " ┌────────── ·                         · ──┐",0dh,0ah
  287.         db    " │ ≡ dΣΣP-CRyPTeR By PLaSMoiD/dΣΣP V.01ß ≡ │",0dh,0ah
  288.         db    " └── ·                         · ──────────┘",0dh,0ah,"$"
  289. mess_openin    db    "        ■ opening file for encryption",0dh,0ah,"$"
  290. mess_create    db    "        ■ creating file for backuping",0dh,0ah,"$"
  291. mess_backup    db    "        ■ backuping file to .bak-file",0dh,0ah,"$"
  292. mess_crypti    db    "        ■ crypting using 256 bit key!",0dh,0ah,"$"
  293. mess_instal    db    "        ■ installing deep decryptcode",0dh,0ah,"$"
  294. mess_closin    db    "        ■ closing file...completed...",0dh,0ah,"$"
  295.  
  296. erro_syntax    db    "        ■ error! run crypter filename",0dh,0ah,"$"
  297. erro_onlyco    db    "        ■ error! only com can be used",0dh,0ah,"$"
  298. erro_nofile    db    "        ■ error! could not found file",0dh,0ah,"$"
  299. erro_corrup    db    "        ■ error! file may be corrupt!",0dh,0ah,"$"
  300. erro_alread    db    "        ■ error! file already crypted",0dh,0ah,"$"
  301. erro_intern    db    "        ■ error! internal error...;)!",0dh,0ah,"$"
  302. ────────────────────────────────────────────────────────────────────────────────
  303. main:        mov    dx,offset mess_crypta
  304.         call    message
  305.         call    getname
  306.         call    openfile
  307.         call    backup
  308.         call    cryptit
  309.         call    install
  310.         call    closefile
  311.         ret
  312. code            ends
  313. ────────────────────────────────────────────────────────────────────────────────
  314. end             deepcrypter
  315.  
  316.  
  317.  
  318.  
  319.